package com.esun.service.service.impl;

import com.esun.service.grpc.GreeterGrpc;
import com.esun.service.grpc.Greeting;
import net.devh.boot.grpc.server.service.GrpcService;

/**
 * @author John.xiao
 * @date 2021/9/22 0:46
 */
@GrpcService
public class GreetingService extends GreeterGrpc.GreeterImplBase {
    @Override
    public void sayHello(com.esun.service.grpc.Greeting.HelloRequest request,
                         io.grpc.stub.StreamObserver<com.esun.service.grpc.Greeting.HelloReply> responseObserver){

        final Greeting.HelloReply reply = Greeting.HelloReply.newBuilder().setMessage("complete").build();
        responseObserver.onNext(reply);
        responseObserver.onCompleted();
    }
}
